package com.cenntro.repair.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.cenntro.auth.mapper.SysSooidMapper;
import com.cenntro.common.base.BaseServiceImpl;
import com.cenntro.common.util.ConvertorUtils;
import com.cenntro.oss.mapper.DevDeviceStaticMapper;
import com.cenntro.oss.model.dbo.DevDeviceStaticDO;
import com.cenntro.repair.mapper.AfterRepairRefMapper;
import com.cenntro.repair.model.dbo.AfterRepairRefDO;
import com.cenntro.repair.model.vo.AfterRepairRefVO;
import com.cenntro.repair.service.AfterRepairRefService;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 
 * @since 2019-07-10
 */
@Service
public class AfterRepairRefServiceImpl extends BaseServiceImpl<AfterRepairRefMapper> implements AfterRepairRefService {

    @Resource
    private AfterRepairRefMapper refMapper;

    @Resource
    private DevDeviceStaticMapper staticMapper;

    @Resource
    private SysSooidMapper sooidMapper;

    @Override
    public List<AfterRepairRefVO> showList(String key, Integer devId) {
        DevDeviceStaticDO staticDO = staticMapper.selectById(devId);
        if (staticDO != null) {
            List<AfterRepairRefDO> refDOList = refMapper.selectByAgentId(staticDO.getAgentId(), key);
            List<AfterRepairRefVO> convertList = ConvertorUtils.deepConvertList(refDOList, AfterRepairRefVO.class);
            System.out.println("-------------------"+refDOList);
            return convertList;
        }
        return null;
    }
}
